import Vuex from 'vuex'
import Vue from 'vue'

Vue.use(Vuex)



let store = new Vuex.Store({
  //1 在state这里定义两个属性
  state: { //存放数据=>数据是响应式 =》data
    MusicDetail: {},
    MusicUrl: '',
    sUrl: '',
    audios: '',
    musicDom: '',
    bgUrl: ''
  },
  mutations: {
    //对 state 中 musicDetai 赋值
    addMusicDetail(state, data) {
      state.MusicDetail = data
    },
    addMusicUrl(state, data) {
      state.MusicUrl = data
    },
    setsUrl(state, url) {
      state.sUrl = url
    },
    setAudios(state, audio) {
      state.audios = audio
    },
    changeMusicDom(state, data) {
      state.musicDom = data
    },
    addMusicBg(state, bgUrl) {
      state.bgUrl = bgUrl
    }
  }
})


export default store